package Demo01;

/**
 * @ClassName Test
 * @Description TODO
 * @Author 李明忠
 * @Date 2025/5/4 23:28
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        User user = new User(100);
        System.out.println(user);

       /* User user1 = user.clone();//编译报错（在编译阶段就检查了
        // user.clone()为Object类型
        // 而左侧 User user1为User类型故不对）*/
        new Test().clone();
//        Object user1 = user.clone();
//        User user2 = (User) user1;
//        System.out.println(user2);
        System.out.println(user.age);
        user.fun();
    }
}
